import Input from '@/components/hhd/design/FormDesigner/field/comps/form/input/Input';
import InputConfig from '@/components/hhd/design/FormDesigner/field/comps/form/input/InputConfig.vue';
import Table from '@/components/hhd/design/FormDesigner/field/comps/layout/table';
import SubTable from '@/components/hhd/design/FormDesigner/field/comps/subTable/SubTable';
import CustomButton from '@/components/hhd/design/FormDesigner/field/comps/custom/button/CustomButton';
import CustomButtonConfig from '@/components/hhd/design/FormDesigner/field/comps/custom/button/CustomButtonConfig.vue';
import Text from '@/components/hhd/design/FormDesigner/field/comps/form/text/Text';
import TextConfig from "@/components/hhd/design/FormDesigner/field/comps/form/text/TextConfig";
import NumberC from '@/components/hhd/design/FormDesigner/field/comps/form/number/Number';
import NumberConfig from "@/components/hhd/design/FormDesigner/field/comps/form/number/NumberConfig";
import Time from '@/components/hhd/design/FormDesigner/field/comps/form/time/Time';
import TimeConfig from "@/components/hhd/design/FormDesigner/field/comps/form/time/TimeConfig";
import Radio from '@/components/hhd/design/FormDesigner/field/comps/form/radio/Radio';
import RadioConfig from "@/components/hhd/design/FormDesigner/field/comps/form/radio/RadioConfig";
import CheckBox from '@/components/hhd/design/FormDesigner/field/comps/form/check/CheckBox';
import CheckBoxConfig from "@/components/hhd/design/FormDesigner/field/comps/form/check/CheckBoxConfig";
import Date from "@/components/hhd/design/FormDesigner/field/comps/form/date/Date";
import DateConfig from "@/components/hhd/design/FormDesigner/field/comps/form/date/DateConfig";
import SelectS from "@/components/hhd/design/FormDesigner/field/comps/form/selectS/SelectS";
import SelectSConfig from "@/components/hhd/design/FormDesigner/field/comps/form/selectS/SelectSConfig";
import SelectM from "@/components/hhd/design/FormDesigner/field/comps/form/selectM/SelectM";
import SelectMConfig from "@/components/hhd/design/FormDesigner/field/comps/form/selectM/SelectMConfig";
import Money from "@/components/hhd/design/FormDesigner/field/comps/form/money/Money";
import MoneyConfig from "@/components/hhd/design/FormDesigner/field/comps/form/money/MoneyConfig";
import Depart from "@/components/hhd/design/FormDesigner/field/comps/business/depart/Depart";
import DepartConfig from "@/components/hhd/design/FormDesigner/field/comps/business/depart/DepartConfig";
import Departs from "@/components/hhd/design/FormDesigner/field/comps/business/departs/Departs";
import DepartsConfig from "@/components/hhd/design/FormDesigner/field/comps/business/departs/DepartsConfig";
import Unit from "@/components/hhd/design/FormDesigner/field/comps/business/unit/Unit";
import UnitConfig from "@/components/hhd/design/FormDesigner/field/comps/business/unit/UnitConfig";
import Units from "@/components/hhd/design/FormDesigner/field/comps/business/units/Units";
import UnitsConfig from "@/components/hhd/design/FormDesigner/field/comps/business/units/UnitsConfig";
import Staff from "@/components/hhd/design/FormDesigner/field/comps/business/staff/Staff";
import StaffConfig from "@/components/hhd/design/FormDesigner/field/comps/business/staff/StaffConfig";
import Staffs from "@/components/hhd/design/FormDesigner/field/comps/business/staffs/Staffs";
import StaffsConfig from "@/components/hhd/design/FormDesigner/field/comps/business/staffs/StaffsConfig";
import UploadFile from "@/components/hhd/design/FormDesigner/field/comps/form/uploadFile/UploadFile";
import UploadFileConfig from "@/components/hhd/design/FormDesigner/field/comps/form/uploadFile/UploadFileConfig";
import Picture from "@/components/hhd/design/FormDesigner/field/comps/form/picture/Picture";
import PictureConfig from "@/components/hhd/design/FormDesigner/field/comps/form/picture/PictureConfig";

const FormFieldRegister = {
  input: {
    comp: new Input(),
    config: InputConfig,
  },
  text: {
    comp: new Text(),
    config: TextConfig
  },
  number: {
    comp: new NumberC(),
    config: NumberConfig
  },
  money: {
    comp: new Money(),
    config: MoneyConfig
  },
  date: {
    comp: new Date(),
    config: DateConfig
  },
  time: {
    comp: new Time(),
    config: TimeConfig
  },
  radio: {
    comp: new Radio(),
    config: RadioConfig
  },
  checkbox: {
    comp: new CheckBox(),
    config: CheckBoxConfig
  },
  selectS: {
    comp: new SelectS(),
    config: SelectSConfig
  },
  selectM: {
    comp: new SelectM(),
    config: SelectMConfig
  },
  uploadFile: {
    comp: new UploadFile(),
    config: UploadFileConfig
  },
  picture: {
    comp: new Picture(),
    config: PictureConfig
  }
};

const BusinessRegister = {
  staff: {
    comp: new Staff(),
    config: StaffConfig
  },
  staffs: {
    comp: new Staffs(),
    config: StaffsConfig
  },
  depart: {
    comp: new Depart(),
    config: DepartConfig
  },
  departs: {
    comp: new Departs(),
    config: DepartsConfig
  },
  unit: {
    comp: new Unit(),
    config: UnitConfig
  },
  units: {
    comp: new Units(),
    config: UnitsConfig
  }
}

const LayoutRegister = {
  table: {
    comp: new Table(),
    config: undefined,
  },
  subTable: {
    comp: new SubTable(),
    config: undefined,
  }
}

const CustomRegister = {
  customButton: {
    comp: new CustomButton(),
    config: CustomButtonConfig,
  }
}

export default FormFieldRegister;

export {
  BusinessRegister,
  LayoutRegister,
  CustomRegister,
  FormFieldRegister,
};

export function getFieldComponent(compname) {
  return BusinessRegister[compname] || FormFieldRegister[compname] || LayoutRegister[compname] || CustomRegister[compname];
}
